#ifndef RRPRIM_H
#define RRPRIM_H

#define VERTS_NUM 100

enum RRPrimType {RR_LINE, RR_LINE_STRIP, RR_LINE_LOOP, RR_TRIANGLE, RR_POLYGON};

class RRFragment {
public:
    int x;
    int y;
    float d;
    float c[4];
};

class RRVertex
{
public:
    float x, y, z, w;
    float c[4];
};

class RRPrim
{
private:
    RRPrimType t;
    RRVertex verts[VERTS_NUM];
    int verts_index;
    float color[4];

public:
    explicit RRPrim();
    void rrSetType(RRPrimType arg);
    RRPrimType rrGetType();
    void rrSetVert(RRVertex arg);
    RRVertex rrGetVert(int index);
    RRVertex rrGetCurrentVert();
    RRVertex *rrGetVertAdrs(int index);
    int rrGetVertsNum();
    float rrGetX(int index);
    float rrGetY(int index);
    void rrReset();
    void rrBegin(RRPrimType type);
    void rrEnd();
    void rrSetVert3f(float x, float y, float z);
    void rrColor4f(float a, float r, float g, float b);
};

#endif // RRPRIM_H
